<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--    {foreach $arr as $key=>$value}-->
<!--       <{$key}> - <{$value.id}> - <{$value.name}> - <{$value.gender}> <br>-->
<!--    {/foreach}-->
    <table border="1">
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>性别</th>
        </tr>
        {volist name='arr' id='v'}
        <tr>
            <th><{$v.id}></th>
            <th><{$v.name}></th>
            <th><{$v.gender}></th>
        </tr>
        {/volist}
    </table>
    <hr>
    <table border="1">
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>性别</th>
        </tr>
<!-- 支持输出查询结果中的部分数据 选择输出第2~4条记录 -->
        {volist name='arr' id='v', offset='2', length='2'}
        <tr>
            <th><{$v.id}></th>
            <th><{$v.name}></th>
            <th><{$v.gender}></th>
        </tr>
        {/volist}
    </table>
    <hr>
    <table border="1">
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>性别</th>
        </tr>
        <!-- 输出id为偶数 -->
        {volist name='arr' id='v', mod='2' empty='暂时没有数据'}
        <tr>
            <th><{$v.id}></th>
            <th>{eq name="mod" value="1"}<{$v.name}>{/eq}</th>
            <th><{$v.gender}></th>
        </tr>
        {/volist}
    </table>
    <hr>
<!-- 循环嵌套 -->
    {volist name='arr2' id='value1'}
        <{$key}> :
        {volist name='value1' id='value2'}
            <{$key}>=><{$value2}>
        {/volist}<br>
    {/volist}

<!-- for循环 -->
    {for start='0' end='10' name='i' step='2' comparison='lt'}
        <{$i}>
    {/for}
    <hr>

<!-- 比较标签 -->
    {eq name='num' value='10.46'}
        对了
    {else}
        不对
    {/eq}
    <hr>

<!-- if条件判断 -->
    {if $point>=90}
        优秀
    {elseif $point>=80}
        良好
    {elseif $point>=60}
        良好
    {else}
        及格
    {/if}
<!-- switch条件判断 -->
    {switch $player}
        {case 战士} 恺 {/case}
        {case 坦克} 廉颇 {/case}
        {case 法师|魔法师} 诸葛亮 {/case}
        {case 刺客} 荆轲 {/case}
        {default} 默认值
    {/switch}
<!-- in标签判断模板变量是否在某个范围内 -->
{in name='id' value='1, 2, 3'}
id在范围内
{else/}
id不在范围内
{/in}

</body>
</html>